using SG3L_RAG.Domain.Entities;

namespace SG3L_RAG.Application.Interfaces
{
    public interface IConversationService
    {
        /// <summary>
        /// 获取用户收藏的会话集合
        /// </summary>
        Task<IEnumerable<Conversation>> GetCollectedByUserIdAsync(Guid userId);

        /// <summary>
        /// 分页获取所有对话
        /// </summary>
        Task<PagedResult<Conversation>> GetAllPagedAsync(int page = 1, int pageSize = 12);

        /// <summary>
        /// 分页获取用户对话列表
        /// </summary>
        Task<PagedResult<Conversation>> GetByUserIdPagedAsync(Guid userId, int page = 1, int pageSize = 12);

        Task<Conversation?> GetByIdAsync(Guid id);
        Task<IEnumerable<Conversation>> GetAllAsync();
        Task<Conversation> CreateAsync(Guid userId);
        Task<Conversation> CreateAsync(Guid userId, string title);
        Task UpdateAsync(Conversation conversation);
        Task DeleteAsync(Guid id);
        Task<IEnumerable<Conversation>> GetByUserIdAsync(Guid userId);
        Task<Conversation?> GetLatestByUserIdAsync(Guid userId);
        Task<IEnumerable<Conversation>> GetRecentConversationsAsync(Guid userId, int count = 10);
        Task AddMessageAsync(Guid conversationId, Message message);
        Task<int> GetMessageCountAsync(Guid conversationId);
        Task SetCollectAsync(Guid conversationId, bool isCollect);
    }
}
